package com.lyz.dataStructure.xiancheng.读写锁;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 11:47
 * @Description:
 **/

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/27 11:47
 *@Description:
 **/
public class Test {
    public static void main(String[] args) {
        ReadWriteLockTest pricesInfo = new ReadWriteLockTest();
        Reader readers[] = new Reader[5];
        Thread threadsReader[] = new Thread[5];
        for (int i = 0; i < 5; i++){
            readers[i] = new Reader(pricesInfo);
            threadsReader[i] = new Thread(readers[i]);
        }
        Writer writer = new Writer(pricesInfo);
        Thread threadWriter = new Thread(writer);
        for (int i = 0; i < 5; i++){
            threadsReader[i].start();
        }
        threadWriter.start();
    }
}
